home *** CD-ROM | disk | FTP | other *** search
/ Atari Mega Archive 1 / Atari Mega Archive - Volume 1.iso / gnu / othergnu / groff.zoo / man.sh < prev    next >
Linux/UNIX/POSIX Shell Script  |  1992-05-10  |  1KB  |  47 lines

  1. #!/bin/sh
  2. if test $TERM = mgr
  3. then
  4.     echo -n "F"
  5.     echo -n ",24w"
  6.     eval `set_termcap`
  7. fi
  8. for i in 1 2 3 4 5 6 7 8 9 l
  9. do
  10.     if test -f $MANPATH/cat$i/$1.$i
  11.     then
  12.         if test $MANPATH/man$i/$1.$i -nt $MANPATH/cat$i/$1.$i
  13.         then
  14.             echo source never... reformatting $1 ...
  15.             rm -f $MANPATH/cat$i/$1.i
  16.             groff -v -man -Tascii $MANPATH/man$i/$1.$i > /tmp/grofftmp
  17.             compress -f < /tmp/grofftmp > $MANPATH/cat$i/$1.$i'z'
  18.             rm -f /tmp/grofftmp
  19.             zcat < $MANPATH/cat$i/$1.$i'z' | less
  20.             exit 0
  21.         fi
  22.         less $MANPATH/cat$i/$1.$i
  23.         exit 0
  24.     else if test -f $MANPATH/cat$i/$1.$i'z'
  25.     then
  26.         if test $MANPATH/man$i/$1.$i -nt $MANPATH/cat$i/$1.$i'z'
  27.         then
  28.             echo source never... reformatting $1 ...
  29.             rm -f $MANPATH/cat$i/$1.i'z'
  30.             groff -v -man -Tascii $MANPATH/man$i/$1.$i > /tmp/grofftmp
  31.             compress -f < /tmp/grofftmp > $MANPATH/cat$i/$1.$i'z'
  32.             rm -f /tmp/grofftmp
  33.         fi
  34.         zcat < $MANPATH/cat$i/$1.$i'z' | less
  35.         exit 0
  36.     else if test -f $MANPATH/man$i/$1.$i
  37.         then echo formatting $1 ...
  38.         groff -v -man -Tascii $MANPATH/man$i/$1.$i > /tmp/grofftmp
  39.         compress -f < /tmp/grofftmp > $MANPATH/cat$i/$1.$i'z'
  40.         rm -f /tmp/grofftmp
  41.         zcat < $MANPATH/cat$i/$1.$i'z' | less
  42.         exit 0
  43.     fi ; fi; fi; 
  44. done
  45. echo No manualpage for $1
  46. exit 1
  47.